package com.vastcom.cms.dao;

import com.vastcom.cms.model.Users;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UsersDao extends JpaRepository<Users,String>{

@Query("select u from Users u where u.username=:username and u.pass=:password")
    List<Users> getUsersByUsernameAndAndPass(@Param("username")String username,@Param("password")String password);

    @Query("select u from Users u where u.username=:username")
    List<Users> getUsersByUsername(@Param("username")String username);

}
